﻿@model IEnumerable<ProjectManager.ViewModels.ManagerModel>
@using ProjectManager.Helpers

<h2>Projects</h2>

<p>
    @Html.ActionLink("Create New", "ProjectCreate") |
    @Html.ActionLink("Show all user's projects", "ProjectsData")
</p>

@*@using (Html.BeginForm("Projects", "Manager", FormMethod.Post, new {name="selCourse", onChange = "document.selCourse.submit()" }))
{
    @Html.DropDownList("ID", new SelectList(ViewBag.courses, "Id", "Name"))
}*@

<table class="manage">
    <tr>
        <th>
            Course
        </th>
        <th>
            Project
        </th>
        <th>
            No
        </th>
        <th>
            Deadline
        </th>
        <th>
            Options
        </th>
    </tr>

@foreach (var item in Model)
{
    <tr>
        <td>
            <abbr title="@item.Course.Name">@Html.Truncate(item.Course.Name, 30)</abbr>                            
        </td>
        <td>
            @Html.ActionLink(item.Project.Name, "ProjectsData", new { id = item.Project.ID })            
        </td>
        <td>
            @item.Project.ProjectNo
        </td>
        <td>
            @String.Format("{0:d}", item.Project.Deadline)
        </td>       
        <td>
            @Html.ActionLink("Edit", "ProjectEdit", new { id = item.Project.ID }) |
            @Html.ActionLink("Delete", "ProjectDelete", new { id = item.Project.ID })
        </td>
 
    </tr>
}

</table>

